//
//  FangwenDetailTableViewCell.m
//  jizhiyunduan
//
//  Created by 鞠超 on 16/4/21.
//  Copyright © 2016年 JC. All rights reserved.
//

#import "FangwenDetailTableViewCell.h"

@implementation FangwenDetailTableViewCell

- (instancetype )initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if(self)
    {
        [self p_setupView];
    }
    
    return self;
}

- (void )p_setupView
{
    self.source = [[UILabel alloc] init];
    self.source.text = @"来自百度PC端访问";
    self.date.textAlignment = NSTextAlignmentLeft;
    self.source.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:self.source];
    
    
    self.date = [[UILabel alloc] init];
    self.date.text = @"2016-12-28 21:22";
    self.date.textAlignment = NSTextAlignmentRight;
    self.date.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:self.date];
    
    
    self.str_IP = [[UILabel alloc] init];
    self.str_IP.text = @"IP地址:[255.255.255.255]山东省临沂市";
    self.str_IP.textAlignment = NSTextAlignmentLeft;
    self.str_IP.textColor = [UIColor grayColor];
    self.str_IP.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.str_IP];
    
}

- (void )layoutSubviews
{
    [super layoutSubviews];
    
    CGFloat length_x = (SCREEN_WIDTH - 25) / 2;
    
    self.source.frame = CGRectMake(15, 10, length_x, 20);

    self.date.frame = CGRectMake(CGRectGetMaxX(self.source.frame) , 10, length_x, 20);
    
    self.str_IP.frame = CGRectMake(15, 35, SCREEN_WIDTH - 20, 20);
}



@end
